<template>
  <div class="app-container">
    <el-row :gutter="10">
      <el-col :span="19">
        <take-car-template-base :detail-info="form"></take-car-template-base>
        <other-template-content :detail-info="form"></other-template-content>
      </el-col>
      <el-col :span="5">
        <operation-record :logs="logs"></operation-record>
      </el-col>
    </el-row>

    <div class="card-wrap flex justify-end card-padding">
      <el-button @click="back">返回</el-button>
    </div>
  </div>
</template>

<script>
import TakeCarTemplateBase from "@/views/contractTemplate/components/otherTemplate/TakeCarTemplateBase.vue";
import OtherTemplateContent from "@/views/contractTemplate/components/otherTemplate/OtherTemplateContent.vue";
import OperationRecord from "@/views/contractTemplate/components/OperationRecord.vue";
import * as contractTemplateApi from "@/api/contractTemplate/takeCarContractTemplate";


export default {
  dicts: ['other_contract_template_type'],
  components: {TakeCarTemplateBase, OtherTemplateContent, OperationRecord},
  data() {
    return {
      form: {},
      logs: []
    }
  },
  computed: {},
  methods: {
    //合同详情
    getContractTemplateDetail() {
      contractTemplateApi.contractTemplateDetails(this.$route.query.id).then(res => {
        this.form = res.data;
        console.log('合同详情-----', this.form)
      })
    },
    //获取操作记录
    getLog() {
      contractTemplateApi.contractTemplateLog(this.$route.query.id).then(res => {
        this.logs = res.data;
      })
    },
    back() {
      this.$router.back()
      this.$store.dispatch('tagsView/delView', this.$route)
    }

  },
  created() {
    if (this.$route.query.id) {
      this.getContractTemplateDetail()
      this.getLog()
    }
  },

}
</script>

<style lang="scss" scoped>


</style>
